home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_MacPaint / Source / shared.subproj / AbstractConverter.m < prev    next >
Text File  |  1995-06-12  |  4KB  |  89 lines

  1. /***********************************************************************\
  2. Common Abstract Converter class for Convert programs
  3. Copyright (C) 1993 David John Burrowes
  4.  
  5. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.
  6.  
  7. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  8.  
  9. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  10.  
  11. The author, David John Burrowes, can be reached at:
  12.     davidjohn@kira.net.netcom.com
  13.     David John Burrowes
  14.     1926 Ivy #10
  15.     San Mateo, CA 94403-1367
  16. \***********************************************************************/
  17.  
  18. #import "AbstractConverter.h"
  19.  
  20. @implementation AbstractConverter
  21.  
  22.  
  23. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  24. //    Method:        init
  25. //    Parameters:    none
  26. //    Returns:     none
  27. //    Stores:        none
  28. //    Description:
  29. //        Initalizes an instance... namely by defining th manager instance as null
  30. //    Bugs:
  31. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  32. - init
  33. {
  34.     myManager = NullInstance;
  35.     return self;
  36. }
  37.  
  38.  
  39. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  40. //    Method:        ReportTo:
  41. //    Parameters:    The caller
  42. //    Returns:     none
  43. //    Stores:        none
  44. //    Description:
  45. //        ConvertController's use this to tell the converter what object to report status
  46. //        to.  That is, we must tell sender when we are, for example, 50% of the way
  47. //        done so it can let the user know what's going on.  Subclasses should have no
  48. //        need of subclassing this.  It will always be set up before a call to the main
  49. //        conversion routine.
  50. //    Bugs:
  51. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  52. - ReportTo: sender
  53. {
  54.     myManager = sender;
  55.     return self;
  56. }
  57.  
  58.  
  59. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  60. //    Method:        isThisAGoodFile:
  61. //    Parameters:    A File instance
  62. //    Returns:     YES if it is, NO if it isn't.
  63. //    Stores:        none
  64. //    Description:
  65. //        A converter, in addition to converting a file X to a file Y, should be able to
  66. //        identify when a source file is a legitimate file for conversion.  In the case of
  67. //        this abstract class, this method does nothing.  A subclass, however, will
  68. //        subclass this method and have it examine the specified file, and determine
  69. //        if it's a legit file or not.  It returns YES if the file is good, or NO if the file is
  70. //        questionable or bad.  
  71. //    Bugs:
  72. //        We need to use the proposed Fact datatype here, instead of Boolean.
  73. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  74. - (Boolean) isThisAGoodFile: Instance
  75. {
  76.     return YES;
  77. }
  78.  
  79.  
  80. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  81. //    Method:        some conversion routine
  82. //    Description:
  83. //        Additionally, subclasses will want to include a routine to convert stuff
  84. //        here. =)
  85. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  86.  
  87. @end
  88.  
  89.